<template>
  <div class="container-box">
    <input type="file" @change="init" :key="timeStamp" />
  </div>
</template>

<script>
import { cutFile } from './utils/cutFile';
export default {
  data() {
    return {
      timeStamp: Date.now()
    };
  },
  methods: {
    async init(e) {
      const file = e.target.files[0];
      if (file) {
        console.time('cutFile耗时');
        const chunks = await cutFile(file);
        console.timeEnd('cutFile耗时');
        this.timeStamp = Date.now();
        console.log('chunks====>', chunks);
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.container-box {
  width: 100%;
  height: 100%;
}
</style>
